<template>
	<!-- 消息为图片开始 -->
	<view class="im-item-box">
		<!-- 时间开始 -->
		<view class="im-time" v-if="itemImg.datetime">
			datetime
		</view>
		<!-- 时间结束 -->
		<view class="im-item im-left">
			<view class="photo">
				<image src=""></image>
			</view>
			<!-- class="msg-img" -->
			<view class="msg-img">
				<image src="" mode=""></image>
			</view>
			<view class="is-read read">送达</view>
		</view>
	</view>
	<!-- 消息为图片结束 -->
</template>
<script>
	import {
		parseTime,
		formatTime
	} from '@/utils/index.js'
	export default {
		props: ['itemImg'],
		data() {
			return {
				previewImgShow: false
			}
		},
		filters: {
			timeFilter(timestamp) {
				return formatTime(timestamp, '{y}-{m}-{d}', true)
			},
			interviewTimeFilter(timestamp) {
				return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}')
			}
		},
		created() {},
		methods: {
			/**
			 * 图片预览
			 */
			handleImagePreview(imgSrc) {
				// ImagePreview([imgSrc])
			}
		}
	}
</script>
<style lang="scss" scoped>
	//聊天记录开始
	.im-item {
		display: flex;
		font-size: 28rpx;
		height: 100%;

		.photo {
			width: 88rpx;
			height: 88rpx;
			border-radius: 50%;
			background: red;

			image {
				width: 100%;
				height: 100%;
				border-radius: 50%;
			}
		}

		.msg {
			max-width: 450rpx;
			padding: 36rpx 34rpx;
		}

		.msg-bg-1 {
			background: #5691FF;
			color: #fff;
			border-radius: 20rpx 0rpx 20rpx 20rpx;
		}

		.msg-bg-2 {
			background: #fff;
			color: #333333;
			border-radius: 0px 20rpx 20rpx 20rpx;
		}

		.msg-img {
			width: 240rpx;
			height: 240rpx;
			display: flex;
			border-radius: 10rpx;
			align-items: center;
			justify-content: center;
			overflow: hidden;
			background: red;

			image {
				min-height: 100%;
				max-width: 100%;
			}
		}

		.is-read {
			font-size: 26rpx;

			&.read {
				// 已读
				color: #C8C8C8;
			}

			&.service {
				//送达
				color: #1887FB;
			}
		}
	}

	.greet-set-up-box {
		text-align: right;
		font-size: 0;

		.greet-set-up {
			// 打招呼设置
			width: 200rpx;
			height: 60rpx;
			background: #E9E9E9;
			border-radius: 6rpx;
			color: #5691FF;
			font-size: 28rpx;
			text-align: center;
			line-height: 60rpx;
			display: inline-block;
			margin-top: 22rpx;
			margin-right: 140rpx;
		}
	}

	//聊天记录结束
</style>
